// pages/home/index.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        bg1:'https://staging-statics.maiscrm.com/modules/danonecommon/wom/game-03/game-main.png',
        rulesbg:' https://staging-statics.maiscrm.com/modules/danonecommon/wom/game-03/game-rule.png',
        // 关闭规则弹框
        flag:true,
        // 单独开始的蒙版开关
        flag1:true,
        // 定义一个图片背景数组
        bgList:[
          " https://staging-statics.maiscrm.com/modules/danonecommon/wom/game-03/prize-001-1.png",
          ' https://staging-statics.maiscrm.com/modules/danonecommon/wom/game-03/prize-002-1.png',
          ' https://staging-statics.maiscrm.com/modules/danonecommon/wom/game-03/prize-003-1.png',
          ' https://staging-statics.maiscrm.com/modules/danonecommon/wom/game-03/prize-004-1.png',
          ' https://staging-statics.maiscrm.com/modules/danonecommon/wom/game-03/prize-005-1.png'
        ],
        prizebg:""
    },
    onChecked(){
        this.setData({
            flag1:false,
            flag:false
        })
    },
    onLook1() {
        this.selectComponent('#dialog').showPopup()
       this.setData({
         prizebg:this.data.bgList[0]
       })
    
      },
      onLook2() {
        this.selectComponent('#dialog').showPopup()

       this.setData({
         prizebg:this.data.bgList[1]
       })
      
      },
      onLook3() {
        this.selectComponent('#dialog').showPopup()
        this.setData({
          prizebg:this.data.bgList[2]
        })
      
      },
      onLook4() {
        this.selectComponent('#dialog').showPopup()
        this.setData({
          prizebg:this.data.bgList[3]
        })
      
      },
      onLook5() {
        this.selectComponent('#dialog').showPopup()
        this.setData({
          prizebg:this.data.bgList[4]
        })
      
      },

      //取消事件
      _error() {
        wx.showToast({
          title: '取消购买',
        })
        // console.log('你点击了取消');
        this.selectComponent('#dialog').hidePopup();
      },
      //确认事件
      _success() {
        // console.log('你点击了确定');
        wx.showToast({
          title: '购买成功',
        })
        this.selectComponent('#dialog').hidePopup();
      },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})